﻿using AiFrame.InterfaceLib.Data.Patterns;

namespace AiFrame.InterfaceLib.MVP
{
    /// <summary>
    /// Represents an abstract list view which allows to manage data items.
    /// </summary>
    /// <typeparam name="T">Type of the data source.</typeparam>
    public interface IDataListView<T>: IAbstractListView
    {
        /// <summary>
        /// Adds an element to the list.
        /// 
        /// WARNING: It doesn't add the item to the 
        /// data layer, only to the view.
        /// </summary>
        /// <param name="item"></param>
        void AddItem(T item);

        /// <summary>
        /// Returns the selected item.
        /// </summary>
        /// <returns></returns>
        T GetSelectedItem();

        /// <summary>
        /// Returns all data items from the 
        /// data layer.
        /// </summary>
        IObservableList<T> DataItems { get; }
    }
}
